﻿function GetReport(rptName, format, pageurl)
{    
    /*  for the prototype the Humans and Agreements reports would be converted to SQL reports. These reports would have the rptHostName filled in    
        All other reports would be served up the old way.
    */            
    if(rptName!='')
    {        
        //window.showModalDialog('reports/sqlreportHost.aspx?rpt=' + rptName + '&fmt='+ format,'','dialogWidth:800px;dialogHeight:600px');
        //window.open('reports/sqlreportHost.aspx?rpt=' + rptName + '&fmt='+ format,'','dialogWidth:800px;dialogHeight:600px');
        var s = '../InsightReports/sqlreportHost.aspx?rpt=' + rptName + '&fmt='+ format + "&pageUrl=" + pageurl;        
        var hiddenSearchCriteria = document.getElementById('hiddenSearchCriteria');
        if (hiddenSearchCriteria != null)
			s = s + "&searchParameters=" + hiddenSearchCriteria.getAttribute('value');
        var win = window.open(s,'rptWin','menubar=0,resizable=1,width=800,height=600');        
        win.focus();
        return false;
    }    
    return true;    
}

